﻿@model IEnumerable<Web>
@{
    Layout = "~/Views/Shared/_Dashboard.cshtml";
}
@UIHelper.ImageTitle(Html.Global("RES_WEBLIST"), Html.Global("WebSiteList_Desc"), Url.Content("~/content/images/icon_internet_48.png"))
@if (Model.Count() > 0)
{
    <table style="width: 100%; padding-top: 10px;">
        @foreach (var web in Model)
        { 
            <tr>
@*                <td>
                    @if (!string.IsNullOrEmpty(web.LogoImageUrl))
                    {
                        <img src="@Url.Content(web.LogoImageUrl)" alt="logo" />
                    }
                </td>*@
                <td>
                    <table style="width: 100%;">
                        <tr>
                            <td>
                                <h2 class="d-section" style="margin: 0px;">
                                    <a href="@Url.Content("~/sites/" + web.Name + "/index.html")">@GE.GetContent(web.Title)</a></h2>
                                <div style="padding: 5px 0px;">@GE.GetContent(web.Description)</div>
                            </td>
                            <td style="width: 100px;">
                                @Ajax.Dna().Button().Click("location=\"" + Url.Action("Index", "Sys", new { Area = "", website = web.Name }) + "\";").LocText("RES_CONSOLE").ImageIcons(Url.Content("~/Content/Images/console.gif")).GetHtml()
                            </td>
                        </tr>
                    </table>
                    <hr />
                    <ul class="d-horizontal-list">
                        <li>@Ajax.Dna().Link("javascript:void(0);").LocText("RES_OWNER").ImageIcons(Url.Content("~/content/images/icon_contact_16.gif")).GetHtml()</li>
                        <li>@Html.UserLink(web.Owner)</li>
                        <li>@Ajax.Dna().Link("javascript:void(0);").LocText("RES_ENABLED").ImageIcons(Url.Content(web.IsEnabled ? "~/content/images/icon_accept_16.png" : "~/content/images/icon_block_16.png")).GetHtml()</li>
                        <li>@Ajax.Dna().Link(Url.Action("PageManager", "DynamicUI", new { Area = "", website = web.Name })).Text(Html.Global("WebSiteList_TotalPages") + " ( " + web.WebPages.Count.ToString() + " )").ImageIcons(Url.Content("~/content/images/icon_aspx_16.png")).GetHtml()</li>
                    </ul>
                </td>
            </tr>
        }
        <tr>
            <td colspan="2" style="padding: 10px;">
                @{Ajax.Dna().Pager("WebPager").Load(Url.Action("List", "Solution")).Render();}
            </td>
        </tr>
    </table>
}
else
{
    <div style="padding: 10px; font-size: 150%;">
        @Html.Global("WebSiteList_NoWebSites")
    </div>
}
